<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Welcome extends CI_Controller {

	/**
	 * Index Page for this controller.
	 *
	 * Maps to the following URL
	 * 		http://example.com/index.php/welcome
	 *	- or -  
	 * 		http://example.com/index.php/welcome/index
	 *	- or -
	 * Since this controller is set as the default controller in 
	 * config/routes.php, it's displayed at http://example.com/
	 *
	 * So any other public methods not prefixed with an underscore will
	 * map to /index.php/welcome/<method_name>
	 * @see http://codeigniter.com/user_guide/general/urls.html
	 */
 
	public function index(){	
		 //welcome page
		 $d['hello'] ="data";		 
		 $views['_content'] = "welcome";
		 $this->template->load('template_landing', $views, $d);
	}

	public function enterPlancode($plancode=''){
		//modal.html
		if($plancode!='') {
			// check with hessian api
			$this->load->library('Maitaidata');
			$subsdetails = $this->maitaidata->getSubscriptionDetails($plancode);
			$checknumresp = $subsdetails->obj;
			//var_dump($subsdetails); die();
			// if true will send 0 and now verification code
			if($subsdetails->status==0 && $checknumresp!=NULL)
			{
				$return['status'] = 0;
				$return['redirect'] = base_url('index.php/retrieve');
			} else {
				$return['status'] = -1;
			} 
		} else {
			$return['status'] = -1;
		}
		die(json_encode($return));
	}
 
}

/* End of file welcome.php */
/* Location: ./application/controllers/welcome.php */